package adc.budget.impl.bs;

import org.springframework.stereotype.Service;

import adc.app.spec.AutheRequiredException;
import adc.app.spec.BsException;
import adc.app.spec.IAutheBs;
import adc.app.spec.IDao;
import adc.app.spec.IUser;
import adc.app.spec.IUserContext;
import adc.app.spec.InvalidCredentialException;

@Service
public class AutheBs implements IAutheBs<IUser> {

    @Override
    public void login(String username, String password) throws InvalidCredentialException, BsException {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void logout() throws BsException {
        // TODO Auto-generated method stub
        
    }

    @Override
    public IDao<IUser> getDao() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public IUser getUser() throws AutheRequiredException, BsException {
        return new IUser() {
            
            private static final long serialVersionUID = 1L;

            @Override
            public Long getId() {
                // TODO Auto-generated method stub
                return null;
            }
            
            @Override
            public void setUsername(String username) {
                // TODO Auto-generated method stub
                
            }
            
            @Override
            public void setPassword(byte[] password) {
                // TODO Auto-generated method stub
                
            }
            
            @Override
            public String getUsername() {
                return "aDc";
            }
            
            @Override
            public byte[] getPassword() {
                // TODO Auto-generated method stub
                return null;
            }
        };
    }

    @Override
    public boolean isAuthenticated() {
        // TODO Auto-generated method stub
        return true;
    }

    @Override
    public void setUserContext(IUserContext userContext) {
        // TODO Auto-generated method stub
        
    }

}
